﻿using System;
using System . Collections . Generic;
using System . Linq;
using System . Text;
using System . Xml . Linq;
using WenceyWang . RichMan4L . Players;

namespace WenceyWang . RichMan4L . Maps
{
	public class AreaRoad : NormalRoad
	{
		long areaID;

		Area area = null;

		public Area Area { get { return area ?? ( area = Map . Currnet . GetArea ( areaID ) ); } set { areaID = value . Id; Area = value; } }

		public override void Stay ( Player player )
		{
			Area?.Stay ( player );
			base . Stay ( player );
		}

		public AreaRoad ( XElement resource ) : base ( resource )
		{
			areaID = Convert . ToInt64 ( resource . Attribute ( nameof ( Area ) ) . Value );
		}
	}
}
